Micron Document
Gemini Proxy


knusper2000.gemcities.com knusper2000.gemcities.com/posts/transparent_lockscreen.gmi
Transparent Lock Screen Hack for KDE

I'd like to lock the screen, but I'd also like that others who pass along see what cool stuff I am working on .
A transparent lock-screen would be the thing I desire. But this is, afaik, impossible in KDE. So let's aim for the next best thing, making a screenshot and using as a wallpaper of the screen locker...

lock-screen-shot.sh
>!/bin/bash

> paths
WALLPAPER_DIR="$HOME/.cache/lockscreen_capture"
mkdir -p "$WALLPAPER_DIR"
SNAPSHOT_PATH="$WALLPAPER_DIR/capture.png"

> old config
OLD_WALLPAPER=$(kreadconfig5 --file kscreenlockerrc
--group Greeter
--group Wallpaper
--group org.kde.image
--group General
--key Image)

> shot the full screen silently with spectacle
spectacle --fullscreen --background --nonotify --output "$SNAPSHOT_PATH"

> Overwrite lock screen wallpaper config with the new screenshot
kwriteconfig5 --file kscreenlockerrc
--group Greeter
--group Wallpaper
--group org.kde.image
--group General
--key Image "file://$SNAPSHOT_PATH"

> start the screensaver and block the shell
busctl --user call org.freedesktop.ScreenSaver /org/freedesktop/ScreenSaver org.freedesktop.ScreenSaver Lock

> write back the previous configuration
kwriteconfig5 --file kscreenlockerrc
--group Greeter
--group Wallpaper
--group org.kde.image
--group General
--key Image "$OLD_WALLPAPER"
Bind this to some key-chord, e.g., "Super-Meta-Ctrl-L", and fire when leaving the desk. Normal lock screen behavior is restored in the end, such that the normal locking commands do not reveal what's on the desk.

Note for KDE 6: the 'kwriteconfig'/'kreadconfig' commands above need to be suffixed with 6 instead of 5.
you're on knusper2000.gemcities.com/posts/transparent_lockscreen.gmi